<?php session_start();?>
<?php
if (isset($_POST['DangKyLienHe']))
{
		
	
			
	$HoTen = $_POST['HoTen'];
	$Email = $_POST['Email'];
	$DienThoai = $_POST['DienThoai'];
	$TieuDe = $_POST['TieuDe'];
	$NoiDung = $_POST['NoiDung'];
	$NgayLienHe = date('d-m-Y') ;
	//kiem tra ma captcha
		if($_SESSION["cap_code"]!=$_POST['captcha'])
		{
			$errors[]="mã captcha không đúng!!!";
		}
		else
		{
			include_once "connection.php";
			$captcha = $_POST['captcha'];
			$query="Insert into lienhe(HoTen,Email,TieuDe, DienThoai, NoiDung, NgayLienHe)values('".$HoTen."','".$Email."','".$TieuDe."','".$DienThoai."','".$NoiDung."','".$NgayLienHe."')";
			$result=mysql_query($query);
			echo 'Bạn đã liên hệ thành công!!!';
		}
		mysql_close($con);
	}
	if(!empty($errors))	
	{
		header("location:../MyView/dslienhe.php?errors[]=".$errors."");
	}


?>
